package com.yjjxt

import org.apache.spark.{SparkConf, SparkContext}

object Hello22Reduce {
  def main(args: Array[String]): Unit = {

    val sparkContext = new SparkContext((new SparkConf().setMaster("local").setAppName("Join" + System.currentTimeMillis())))
    val array1 = Array[String]("a", "b", "c", "d", "e")
    val lines1 = sparkContext.parallelize(array1, 3)

    println(lines1.reduce((x, y) => {
      x.concat("-" + y)
    }))
  }
}
